﻿
@{
    ViewBag.Title = "SetSpaceMap";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}


@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
    <style>
        th {
            text-align: center;
            font-weight: bold;
        }

        td {
            text-align: center;
            vertical-align: middle;
        }
    </style>
}
<div class="page-content" ng-cloak ng-controller="FireControlController" ng-init="AddModel={};GetPlaceTree(AddModel);
     ">

    <div class="load" ng-show="DataLoading">
        <div class="loader">
            <svg version="1.1" id="loader-1" x="0px" y="0px" width="100px" height="100px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
            <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
            <animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="1s" repeatCount="indefinite" />
			</path>
		</svg>
            <div class="load-msg" ng-bind="LoadingMsg"></div>
        </div>
    </div>
    <div class="page-heading">
        <h1>设施点位标识</h1>
        <div class="options">
            <div class="btn-toolbar">
            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>消防管理</a></li>
        <li class="active"><a>设置场所平面图</a></li>
    </ol>
    <div class="container-fluid">
        <div class="row">
            <form class="form-horizontal row-border">
                <div class="col-lg-3">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            场所选择
                        </div>
                        <div class="panel-body" style="height:600px;overflow-y:scroll;">
                            <div id="tree-default">
                                <ul>
                                    <li data-jstree='{ "icon" : "fa fa-home text-success" }' id="1_{{x.Id}}" ng-repeat="x in ParkTreeList">
                                        <span>{{x.ParkName}}</span>
                                        <ul ng-show="x.BuildingList>0">
                                            <li ng-repeat="y in x.BuildingList" id="2_{{y.Id}}" data-jstree='{ "icon" : "fa fa-building text-primary" }'>
                                                <span>{{y.BuildingName}}</span>
                                                <ul ng-show="y.FloorList>0">
                                                    <li data-jstree='{ "icon" : "fa fa-bookmark" }' id="3_{{z.Id}}" ng-repeat="z in y.FloorList">
                                                        <span> {{z.FloorName}}</span>
                                                        <ul ng-show="z.RoomList>0">
                                                            <li data="{{r.Id}}" id="4_{{r.Id}}" data-jstree='{ "type" : "file" }' ng-repeat="r in z.RoomList">
                                                                {{r.RoomName}}
                                                            </li>
                                                        </ul>
                                                    </li>
                                                </ul>
                                            </li>
                                        </ul>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-9">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            已有平面图
                        </div>
                        <div class="panel-body">
                            <table class="table table-striped table-bordered table-hover">
                                <thead>
                                    <tr>
                                        <th>序号</th>
                                        <th>文件名</th>
                                        <th>文件大小</th>
                                        <th>缩率图</th>
                                        <th>上传时间</th>
                                        <th>上传人</th>
                                        <th>已设置坐标数量</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr ng-show="MapList==null || MapList.length==0">
                                        <td colspan="8">暂未上传</td>
                                    </tr>
                                    <tr ng-repeat="x in MapList">
                                        <td>{{$index+1}}</td>
                                        <td>{{x.ImageInfo.FileName}}</td>
                                        <td>{{x.ImageInfo.FileSize}} kb</td>
                                        <td><img ng-src="{{x.ImageInfo.FilePath}}" width="50" /></td>
                                        <td>{{x.CreateTime|JSONDate:'yyyy-MM-dd HH:mm:ss'}}</td>
                                        <td>{{x.CreateUserName}}</td>
                                        <td>{{x.PointList.length}}</td>
                                        <td><a class="btn btn-success btn-xs btn-label" href="SetMapEquPoint?Id={{x.Id}}"><i class="fa fa-flag"></i>设置点位</a>
                                        
                                         <button ng-click="DeleteSpaceMap(x.Id,x)" type="button" class="btn btn-danger btn-xs btn-label"><i class="fa fa-trash"></i>删除</button></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
                <div class="col-lg-9">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            上传平面图
                        </div>
                        <div class="panel-body">
                            <div class="form-group">
                                <label class="col-sm-1 control-label">场所名称<span class="not-null">*</span></label>
                                <div class="col-lg-11">
                                    <input type="text" class="form-control" ng-model="AddModel.SpaceName" disabled/>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">上传平面图<span class="not-null">*</span></label>
                                <div class="col-lg-11">
                                    <input type="file" ngf-select ng-model="doc.Files" multiple name="docfiles" id="docfiles" class="file" initialPreviewAsData="true" data-show-remove="true" data-show-preview="true" showCancel="false" data-show-upload="false" accept="image/gif, image/jpeg,image/png,image/jpg" required>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label">备注<span class="not-null"></span></label>
                                <div class="col-lg-11">
                                    <input type="text" class="form-control" ng-model="AddModel.Remark"/>
                                </div>
                            </div>
                        </div>
                        <div class="panel-footer">
                            <button class="btn btn-primary" ng-click="SubmitSpaceMap(AddModel);">提交</button>
                        </div>
                    </div>
                </div>

            </form>
        </div>
    </div>
</div>


@section Js{
    <script src="~/Assets/js/pg/FireControl.js?v=@DateTime.Now.ToString("yyMMddHHmm")"></script>
    <script src="~/Assets/js/libs/moment.min.js"></script>
    <script src="~/Assets/js/libs/locales/date/zh-cn.js"></script>
    <script src="~/Assets/js/libs/bootstrap-datetimepicker.min.js"></script>
    <script src="~/Assets/js/libs/angularjs-datepicker.js"></script>
    <script src="~/Assets/js/libs/fileinput.js"></script>
    <script src="~/Assets/js/libs/zh.js"></script>
    <script>
        $('#docfiles').fileinput({
            language: 'zh'
        });

        function loading() {
            $("#div_loading").show();
            setTimeout(function () {
                $("#div_loading").hide();
            }, 3000);
        }
    </script>
}



